<template>
  <div class="app" id='HTMLcake'>
    <head-temp title='资讯' headType='0'></head-temp>
    <div class="contianier">
      <p>{{title}}</p>
      <div class="fromWhere">
        <span>来源:</span>
        <span>未知</span>
        <!-- <span>作者:</span>
        <span>{{author}}</span>-->
      </div>
      <img :src="img" />
      <div v-html="Html" class="HTMLcake"></div>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { getHistoryRecord } from "@/api/user";
import headTemp from '@/components/head2'
export default {
  name: "realtimeInfo",
  data() {
    return {
      Html: "",
      title: "",
      img: "",
      author: "",
      id: "",
      mid: ""
    };
  },
  components:{
    headTemp
  },
  methods: {
    handgoback() {
      this.$router.back(-1);
    }
  },
  created() {
    this.id = this.$route.query.id;

    this.mid = this.$route.query.mid;

    // 获取 01 4740 这连个参数进行拼接
    getHistoryRecord({ mid: this.mid, id: this.id }).then(res => {
      this.Html = res.data.data.data[0].text;
      console.log(res.data.data.data[0]);
      this.title = res.data.data.data[0].title;
      this.img = this.keyUrl + res.data.data.data[0].image;
      this.author = res.data.data.data[0].author;
    });
  }
};
</script>

<style lang='less' scoped >
.app {
  padding:0;
  margin: 0;
  box-sizing: border-box;
  background: #ffffff;
  height: 100%;
}
.header {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  height: 0.4rem;
  align-items: center;
  font-size: 0.18rem;
  color: #000000;
  border-bottom: 0.01rem solid #e4e4e4;
  background: rgba(255, 255, 255);
}
.header img {
  position: absolute;
  height: 0.2rem;
  left: 0.1rem;
}
.contianier {
 padding: .55rem .1rem .1rem;
}
p {
  color: #000000;
  font-size: 0.18rem;
  margin: 0.2rem 0;
  font-weight: 600;
  text-align: center;
  word-wrap:break-all
}
.contianier img {
  width: 100%;
  margin: 0.2rem 0;
}
.fromWhere {
  width: 100%;
  height: 0.22rem;
  font-size: 0.15rem;
  font-weight: 400;
  line-height: 0.22rem;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.fromWhere span {
  margin-right: 0.05rem;
}
.HTMLcake {
  font-size: 0.14rem;
  line-height: 0.3rem;
  margin: 0.1rem 0;
  color: #000000;
  font-weight: 400;
  word-wrap: break-word;
    word-break: normal;
}
</style>
<style type="text/css">
  #HTMLcake p{
    word-break:break-all;
  }
  #HTMLcake img{
    width: 100%;
    height: auto;
  }
</style>